package exp3

import org.apache.spark.api.java.function.MapFunction

class fun {
  protected def addOne(ls: List[Int]):Any={
    ls[Int]=ls.map(_+1)
  }
  def filterEven(ls:List[Int]):Any={
    ls[Int]=ls.filter(_%2==0)
  }
  def mapReduce(list: List[Int])(mapFunc :Int=>Int)(ReduceFunc :(Int,Int)=>Int):Int={
    list.map(mapFunc).reduce(ReduceFunc)
  }
}
